<!DOCTYPE html>
<html lang="en" style="background:#fff;">
<head>
    <base href="${basePath}">
    <#include "common/top.html"/>
</head>
<body style="background:#fff;overflow: hidden">
<form class="layui-form" modelAttribute="uStation" name="form1" id="form1" method="post">
    <div class="layui-form-item-dept">

        <input name="id" name="id" value="${uStation.id}" type="hidden">

        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label"><span
                        style="color: red;">*</span>安装地址：</label>
                <div class="layui-input-inline">
                    <input class="layui-input" type="text" name="address" id="address"
                           value="${uStation.address}" maxlength="50"
                           placeholder="这里输入安装地址" title="安装地址"/>
                </div>
            </div>

            <div class="layui-inline">
                <label class="layui-form-label"><span
                        style="color: red;">*</span>编号：</label>
                <div class="layui-input-inline">
                    <input class="layui-input" type="text" name="code" id="code"
                           value="${uStation.code}" maxlength="50"
                           placeholder="这里输入编号" title="编号"/>
                </div>
            </div>
        </div>

        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label"><span
                        style="color: red;">*</span>所属矿：</label>
                <div class="layui-input-inline">
                    <input class="layui-input" type="text" name="idmine" id="idmine"
                           value="${uStation.idmine}" maxlength="50"
                           placeholder="这里输入所属矿" title="所属矿"/>
                </div>
            </div>

            <div class="layui-inline">
                <label class="layui-form-label"><span
                        style="color: red;">*</span>状态：</label>
                <div class="layui-input-inline">
                    <input class="layui-input" type="text" name="state" id="state"
                           value="${uStation.state}" maxlength="50"
                           placeholder="这里输入状态" title="状态"/>
                </div>
            </div>
        </div>

        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">通讯开始时间：</label>
                <div class="layui-input-inline">
                    <input name="commbegin" id="commbegin" value="${uStation.commbegin?string('yyyy-MM-dd HH:mm:ss')}"
                           class="layui-input" placeholder="yyyy-MM-dd" type="text">
                </div>
            </div>

            <div class="layui-inline">
                <label class="layui-form-label">串口/端口号：</label>
                <div class="layui-input-inline">
                    <input class="layui-input" type="text" name="comport" id="comport"
                           value="${uStation.comport}" maxlength="50"
                           placeholder="这里输入串口/端口号" title="串口/端口号"/>
                </div>
            </div>
        </div>

        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">纬度：</label>
                <div class="layui-input-inline">
                    <input class="layui-input" type="text" name="gisY" id="gisY"
                           value="${uStation.gisY}" maxlength="50"
                           placeholder="这里输入纬度" title="纬度"/>
                </div>
            </div>

            <div class="layui-inline">
                <label class="layui-form-label"><span
                        style="color: red;">*</span>地图显示：</label>
                <div class="layui-input-inline">
                    <input class="layui-input" type="text" name="gisuse" id="gisuse"
                           value="${uStation.gisuse}" maxlength="50"
                           placeholder="这里输入地图显示" title="地图显示"/>
                </div>
            </div>
        </div>

        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label"><span
                        style="color: red;">*</span>分站类型：</label>
                <div class="layui-input-inline">
                    <@c.dictselect type='stationtype' code='${uStation.stationtype}'>
                </@c.dictselect>
            </div>
        </div>


        <div class="layui-inline">
            <label class="layui-form-label"><span
                    style="color: red;">*</span>分站站号：</label>
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="stationId" id="stationId"
                       value="${uStation.stationId}" maxlength="50"
                       placeholder="这里输入分站站号" title="分站站号"/>
            </div>
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label"><span
                    style="color: red;">*</span>机构号：</label>
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="groupId" id="groupId"
                       value="${uStation.groupId}" maxlength="50"
                       placeholder="这里输入机构号" title="机构号"/>
            </div>
        </div>

        <div class="layui-inline">
            <label class="layui-form-label">通讯结束时间：</label>
            <div class="layui-input-inline">
                <input name="commend" id="commend" value="${uStation.commend?string('yyyy-MM-dd HH:mm:ss')}"
                       class="layui-input" placeholder="yyyy-MM-dd" type="text">
            </div>
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">通讯状态：</label>
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="commstate" id="commstate"
                       value="${uStation.commstate}" maxlength="50"
                       placeholder="这里输入通讯状态" title="通讯状态"/>
            </div>
        </div>

        <div class="layui-inline">
            <label class="layui-form-label">IP地址：</label>
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="ip" id="ip"
                       value="${uStation.ip}" maxlength="50"
                       placeholder="这里输入IP地址" title="IP地址"/>
            </div>
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">经度：</label>
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="gisX" id="gisX"
                       value="${uStation.gisX}" maxlength="50"
                       placeholder="这里输入经度" title="经度"/>
            </div>
        </div>
    </div>
    </div>
</form>
</body>
<script type="text/javascript">

    layui.use(['form', 'table', 'laydate'], function () {
        var form = layui.form;
        var laydate = layui.laydate;

        laydate.render({
            elem: '#commbegin'
        });

        $("#stationtype  option").each(function () {
            if ($(this).val() == "${uStation.stationtype}") {
                $(this).attr("selected", true)
            }
        });
        laydate.render({
            elem: '#commend'
        });

        form.render();

    });


    function submitHandler() {
        var prefix = basePath + "device/station";

        $.operate.post(prefix + '/updateUStation', $("#form1").serializeArray(), function (result) {
            if (result.status == true) {
                layer.alert(result.msg, function (index) {
                    var index1 = parent.layer.getFrameIndex(window.name); //获取窗口索引
                    parent.layer.close(index1);
                    layer.close(index);
                });
            } else {
                parent.layer.alert(result.msg);
            }
        });
    }
</script>
</body>
</html>
